# 实现数字转进制字符串。
def toString(num,base):
    convertString = '0123456789ABCDEF'
    if num < base:
        return convertString[num]
    else:
        return toString(num//base,base) + convertString[num % base]

if __name__ == '__main__':
    print(toString(1234,16))